import { axurl } from '@/shared/axurl';

const Model = {
  namespace: 'login',
  state: {
    status: undefined,
  },
  effects: {
    *logout() {
      const user = JSON.parse(localStorage.getItem('ax-data-user'));
      const app = JSON.parse(localStorage.getItem('ax-data-app'));
      localStorage.setItem('ax-auth-token', null);
      document.location.href = `${axurl.system.logout}/?userId=${user.userId}&appId=${app.appId}`;
    },
  },
  reducers: {},
};
export default Model;
